﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="True" CodeBehind="EditAdministrator.aspx.cs" Inherits="Cms.Web.UI.Admin.EditAdministrator" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        //<![CDATA[
        function updateAvailableSitesWhenAdminGroupChanges() {
            var ddlGroups = document.getElementById("ctl00_body_ddlAdministratorGroups");
            var groupID = ddlGroups[ddlGroups.selectedIndex].value;
            var checkboxes = document.getElementById("tblAvailableSites").getElementsByTagName("input");
            if (groupID == 1) {
                for (var i = 0; i < checkboxes.length; i++) {
                    checkboxes[i].disabled = true;
                    if (checkboxes[i].parentNode.tagName.toLowerCase() == "span")
                        checkboxes[i].parentNode.disabled = true;
                    checkboxes[i].checked = true;
                }
            }
            else {
                for (var i = 0; i < checkboxes.length; i++) {
                    checkboxes[i].disabled = false;
                    if (checkboxes[i].parentNode.tagName.toLowerCase() == "span")
                        checkboxes[i].parentNode.disabled = false;
                }
            }
        }

        function updateCheckbox(td) {
            if (td.previousSibling.childNodes[0].disabled)
                return; 
            td.previousSibling.childNodes[0].checked = !(td.previousSibling.childNodes[0].checked);
        }
	    //]]>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="buttons" runat="server">
    <asp:LinkButton ID="lbSave" runat="server" OnClick="lbSave_Click" CssClass="orangeButton"><span><span><img src="Admin/Img/icons/disk.png" alt="" /><span><cms:LocalizedLiteral ID="llSave" runat="server" /></span></span></span></asp:LinkButton>
    <a href="Admin/Administrators.aspx" class="orangeButton"><span><span><img src="Admin/Img/icons/delete.png" alt="" /><span><cms:LocalizedLiteral ID="llCancel" runat="server" /></span></span></span></a>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="body" runat="server">
    <asp:Literal ID="litIcon" runat="server" Visible="false" Text="Admin/Img/Icons/user_edit.png" />
    <asp:UpdatePanel ID="upnlProperties" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <table class="editForm">
                <tr>
                    <td><cms:LocalizedLiteral ID="llUsername" runat="server" />:</td>
                    <td><asp:TextBox ID="txtUsername" runat="server" Width="250" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llPassword" runat="server" />:</td>
                    <td>
                        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="250" />
                        <input type="hidden" id="hidPassword" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llEmail" runat="server" />:</td>
                    <td><asp:TextBox ID="txtEmail" runat="server" Width="250" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llAdministratorGroup" runat="server" />:</td>
                    <td><asp:DropDownList ID="ddlAdministratorGroups" runat="server" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llFirstname" runat="server" />:</td>
                    <td><asp:TextBox ID="txtFirstname" runat="server" Width="250" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llLastname" runat="server" />:</td>
                    <td><asp:TextBox ID="txtLastname" runat="server" Width="250" /></td>
                </tr>
                <tr id="trAvailableSites" runat="server">
                    <td><cms:LocalizedLiteral ID="llAvailableSites" runat="server" />:</td>
                    <td>
                        <table id="tblAvailableSites">
                            <ilib:iRepeater ID="rpAvailableSites" runat="server" Columns="3" OnItemDataBound="rpAvailableSites_ItemDataBound">
                                <HeaderTemplate><tr></HeaderTemplate>
                                <ItemTemplate>
                                    <td style="padding: 0px;"><asp:CheckBox ID="chkSite" runat="server" AutoPostBack="true" OnCheckedChanged="chkSite_Changed" /></td><td width="160" style="cursor: default;" onclick=" updateCheckbox(this);"><asp:Literal ID="litSite" runat="server" /></td>
                                </ItemTemplate>
                                <NewRowTemplate></tr><tr></NewRowTemplate>
                                <FooterTemplate></tr></FooterTemplate>
                            </ilib:iRepeater>
                        </table>
                    </td>
                </tr>
                <tr id="trDefaultSite" runat="server">
                    <td><cms:LocalizedLiteral ID="llDefaultSite" runat="server" />:</td>
                    <td><asp:DropDownList ID="ddlDefaultSites" runat="server" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llDefaultSystemLocale" runat="server" />:</td>
                    <td><asp:DropDownList ID="ddlSystemLocales" runat="server" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llDateFormat" runat="server" />:</td>
                    <td><asp:TextBox ID="txtDateFormat" runat="server" MaxLength="20" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llTimeFormat" runat="server" />:</td>
                    <td><asp:TextBox ID="txtTimeFormat" runat="server" MaxLength="20" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llFirstDayOfWeek" runat="server" />:</td>
                    <td><asp:DropDownList ID="ddlDaysOfWeek" runat="server" /></td>
                </tr>
                <tr>
                    <td><cms:LocalizedLiteral ID="llShowIntroHelp" runat="server" /></td>
                    <td><asp:CheckBox ID="chkShowIntroHelp" runat="server" /></td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
